package book;
//书类
public class Book {
    private String name;//书名
    private String author;//作者
    private int price;//价格
    private String type;//类型
    private boolean isBorrowed;//状态
    public Book(String name, String author, int price, String type) {//构造函数
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }

    public String getName() {//获取书名
        return name;
    }//过去书名

    public void setName(String name) {//更改书名
        this.name = name;
    }//修改书名

    public String getAuthor() {//获得作者
        return author;
    }//获取作者

    public void setAuthor(String author) {//更改作者
        this.author = author;
    }//修改作者

    public int getPrice() {//获得价格
        return price;
    }//获取价格

    public void setPrice(int price) {//更改价格
        this.price = price;
    }//修改价格

    public String getType() {//获得类型
        return type;
    }

    public void setType(String type) {//更改类型
        this.type = type;
    }//修改类型

    public boolean getisBorrowed() {//获得状态
        return isBorrowed;
    }//获取状态

    public void setBorrowed(boolean borrowed) {//更改状态
        isBorrowed = borrowed;
    }//修改状态·

    @Override
    public String toString() {//打印图书
        return "Book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", price=" + price +
                ", type='" + type + '\'' +
                ", isBorrowed=" + isBorrowed +
                '}';
    }
}
